# Copyright (C) 2007  David Were
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
#

from scheduler.Base import *

class Scheduler(BaseScheduler):
    _nextpid =0
    _highpid =0
    _lastnode = -1
    
    def __init__(self):
        BaseScheduler.__init__(self)  
        
    def findProcess(self,_nl,home):
        nl = _nl
        
        """Check if home load is above threshold"""
        if home:
            if nl[x].load < 0.75:
                    return false
        """need to implement process selection"""        
        return false
    
    def findNode(self):
        return false
    
class Acceptor(BaseAcceptor):
    
    def __init__(self):
        BaseAcceptor.__init__(self)
        
    def acceptProcess(self, _procStat,home,nl):
        """ Check if this node (I) can do this process too. """
        if ln[home].load > 0.75:
            return False
        else:
            return True